home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor1 / cprac.src < prev    next >
Text File  |  1990-10-09  |  4KB  |  127 lines

  1. %%HP: T(3)A(D)F(.);
  2. @ by Preston Brown
  3. DIR
  4. @ CPRAC - practice card counting for blackjack
  5. @ This program requires the CASINO 48 application card.
  6. @ The Casino 48 card must be installed when downloading this file.
  7. @
  8. @ Casino 48 is a fun-filled simulation of a casino for the HP-48SX.
  9. @ It includes four games: Blackjack, Video Poker, Slots and Roulette.
  10. @ It also includes commands for drawing cards onto the screen.  
  11. @ This program uses those commands to practice card counting.
  12. @ With card counting the odds in blackjack can be improved to 
  13. @ give the player an advantage over the house.
  14. @
  15. @ To win at blackjack you first need a good basic strategy,
  16. @ Casino 48 includes a recommend function in blackjack which
  17. @ should be used to learn the best strategy.  Once the strategy
  18. @ is mastered, card counting can be used to set your bet.
  19. @ This program allows you to practice a very simple but effective
  20. @ counting technique.  If you wish to use a more advanced method
  21. @ the CALC procedure can be easily modified for other methods.
  22. @
  23. @ SIMPLE COUNT METHOD:
  24. @ For each 3, 4, 5, or 6 add 1 to the count
  25. @ For each 10-valued card subtract 1 from the count
  26. @ Betting:
  27. @  COUNT       BET UNITS
  28. @    <0           1
  29. @    0,1          2
  30. @    2            3
  31. @    3,4,5        4
  32. @    >6           5 or more (be careful the casino may be watching)
  33. @
  34. @ This simple count does not require the player to keep track
  35. @ of the number of cards remaining in the deck but is still effective.
  36. @ A positive count with most of the deck played is more favorable
  37. @ then with most of the deck unplayed.
  38. @ ************************** NOTICE *****************************
  39. @ Preston Brown Labs does not endorse or recommend card counting.
  40. @ Preston Brown Labs is not responsible for any consequential damages.
  41. @ This program may be distributed freely; in ASCII form with the
  42. @ above information intact.
  43. @
  44. HELP
  45. \<< CLLCD TEXT 3 FREEZE
  46. @123456789012345678912
  47. "Enter number of cards" 1 DISP
  48. "to count: press CPRAC" 2 DISP
  49. "Add 1 for 3-6"         3 DISP
  50. "Sub 1 for 10 valued"   4 DISP
  51. "Raise BET for high"    6 DISP
  52. "counts!"               7 DISP
  53. \>>
  54.  
  55. CPRAC               @ Main practice program
  56. \<< 
  57. IF CHECKCARD THEN   @ Check for Casino 48 card
  58.      ECAR
  59.      {#0 #0} PVIEW
  60.      0                    @ Initial Count
  61.      SWAP 1 SWAP START
  62.             GETCARD DUP DCAR CALC SPEED WAIT ECAR
  63.             NEXT
  64.      ELSE
  65.      CLLCD 3 FREEZE
  66.      @123456789012345678912
  67.      "Requires Casino 48"    1 DISP
  68.      "Ask your HP dealer or" 3 DISP
  69.      "send check for $65 to" 4 DISP
  70.      "Preston Brown Labs"    5 DISP
  71.      "  2597 Pierce"         6 DISP
  72.      "Eugene, OR 97405"      7 DISP
  73.      END
  74. \>> 
  75.  
  76. SPEED 0.5           @ Default Speed (set to any value > 0)
  77.                     @ The larger the value the slower the 
  78.                     @ speed
  79.  
  80. CALC
  81. \<< 
  82. IP
  83. CASE
  84.   DUP 9 > THEN DROP 1 - END            @ 10 Valued Cards subtr 1
  85.   DUP 2 > SWAP 7 < AND THEN 1 + END    @ 3-6 add 1
  86. END
  87. \>>
  88.  
  89. SHUF                @ Shuffle 4 decks of cards
  90. \<< TEXT CLLCD
  91. "Shuffling..." 1 DISP
  92. "                          " DUP + DUP + DUP + 'DECK' STO 
  93. 0 51 FOR i i CHR NEXT 
  94. 52 DUPN 104 DUPN 
  95. 208 1 FOR I I RAND * .5 + ROLL DECK I ROT REPL 'DECK' STO -1 STEP 
  96. 209 CHR 'DECK' STO+
  97. "Shuffle Done" 1 DISP 
  98. 1000 1 BEEP
  99. {#0 #0} PVIEW
  100. \>>
  101.  
  102. GETCARD
  103. \<< 
  104. @GETCARD Check deck and get a card
  105. IF DECK NUM 1 < THEN SHUF END
  106. DECK DUP NUM \-> D N
  107.   \<< D 1 N 1 - CHR REPL 'DECK' STO 
  108.       D N DUP SUB NUM 
  109.       DUP 13 MOD 1 + SWAP 4 MOD 1 + 10 / +
  110.   \>>
  111. \>>
  112.  
  113. CHECKCARD   @ This function clears the last arg flag
  114. \<< -55 CF  @ Enable last args to get predictable results
  115.     IFERR 1 PVARS DROP :1:769 POS THEN DROP 0 END
  116.     IFERR 2 PVARS DROP :2:769 POS THEN DROP 0 END
  117.     OR
  118. \>>
  119.  
  120.  
  121. @ Other Variables
  122. CRDX 0
  123. DECK ""
  124.  
  125. END
  126.